Policies and rules are widely used in network applications. For example, conventionally, policies may be used to statistically multiplex packets. Further, network applications, such as packet routing, packet classification, access control for network security, virtual local network (VLAN), and the like, may utilize policies and rules to provide quality of service (QoS). For example, a VLAN membership can be based on a subnet field and a protocol port number. Therefore, a packet switching device may include policies and rules that check the subnet field and the protocol port number of a packet to direct a transmission of the packet.
A policy may include one or more rules. Each rule can generally include one or more conditions, as well as an action that is associated with the conditions. The action can be applied when the conditions are satisfied. In a software based rule testing technique, rules can be implemented in software as conditional statements, such as “CASE” statement. The conditional statements can be executed by a processor to test a packet against a predefined set of rules. However, such software based rule testing techniques can result in a bottleneck for packet switching, as a result of insufficient fast software execution speed.